﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace MN.Framework
{
    [Serializable]
    public class MnMessage
    {
        // Fields
        private string componentField;
        private string defaultValueField;
        private string nameField;

        // Methods
        public MnMessage(string component, string name, string defaultValue)
        {
            this.Component = component;
            this.nameField = name;
            this.defaultValueField = defaultValue;
        }

        public override string ToString()
        {
            return this.DefaultValue;
        }

        //public string Translate()
        //{
        //    string str = TranslationService.Translate(this);
        //    if (string.IsNullOrEmpty(str))
        //    {
        //        return this.DefaultValue;
        //    }
        //    return str;
        //}

        // Properties
        [XmlAttribute]
        public string Component
        {
            get
            {
                return this.componentField;
            }
            set
            {
                this.componentField = value;
            }
        }

        [XmlAttribute]
        public string DefaultValue
        {
            get
            {
                return this.defaultValueField;
            }
            set
            {
                this.defaultValueField = value;
            }
        }

        [XmlAttribute]
        public string Name
        {
            get
            {
                return this.nameField;
            }
            set
            {
                this.nameField = value;
            }
        }
    }
}
